function [MI_Structure] = Pull_Out_MI_Single_Session(Placeness_MetaData, Row_Number)

% pull out the MI value & its corresponding p-value against null
% distribution for a specific row
MI_values(:,2) = Placeness_MetaData(Row_Number).MI_values;
for n = 1:size(MI_values,1)
    MI_values(n,1) = n;
end
for n = 1:size(MI_values,1)
    if isnan(MI_values(n,2))
        MI_values(n,:) = nan;
    end
end
MI_values(isnan(MI_values)) = [];
MI_values = reshape(MI_values, [], 2);

MI_p_values(:,2) = Placeness_MetaData(Row_Number).MI_p_values;
for n = 1:size(MI_p_values,1)
    MI_p_values(n,1) = n;
end
for n = 1:size(MI_p_values,1)
    if isnan(MI_p_values(n,2))
        MI_p_values(n,:) = nan;
    end
end
MI_p_values(isnan(MI_p_values)) = [];
MI_p_values = reshape(MI_p_values, [], 2);

% make a structure that summarizes useful experimental conditions
MI_Structure_Original = struct(...
    'session', Row_Number,...
    'cell_ID', [],...
    'genotype', Placeness_MetaData(Row_Number).genotype,...
    'animal_ID', Placeness_MetaData(Row_Number).animalName,...
    'expt_date', Placeness_MetaData(Row_Number).exptDate1,...
    'expt_time', Placeness_MetaData(Row_Number).session,...
    'drug', Placeness_MetaData(Row_Number).drug,...
    'session1_dose', Placeness_MetaData(Row_Number).session1_dose,...
    'exptParadigm', Placeness_MetaData(Row_Number).exptParadigm,...
    'Mobility', Placeness_MetaData(Row_Number).Mobility,...
    'Mobility_Pass', Placeness_MetaData(Row_Number).Mobility_Pass);
MI_Structure = MI_Structure_Original;
    
% duplicate this structure for N times, where N is the number of non-NAN MI values in
% that session
for n = 1:(size(MI_values,1)-1)
    MI_Structure = cat(1, MI_Structure, MI_Structure_Original);
end

% Now put all MI_values & MI_p_values into that structure
for n = 1:size(MI_Structure,1)
    MI_Structure(n).cell_ID = MI_values(n,1);
    MI_Structure(n).MI_values = MI_values(n,2);
    MI_Structure(n).MI_p_values = MI_p_values(n,2);
end

end
